<template>
  <div class="dashboard-container">
    <img class="dashboard-image" :src="welcomeImage" alt="Welcome Image">
    <div class="dashboard-text">欢迎您！</div>
    <div class="dashboard-text">用户名: {{ name }}</div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import welcomeImage from '@/assets/welcome.png'

export default {
  name: 'Dashboard',
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  data() {
    return {
      welcomeImage
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px auto;
    padding: 40px;
    max-width: 800px;
    background-color: #f0f4f8;
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;

    &:hover {
      background-color: #e6ecf1;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }
  }

  &-text {
    font-size: 30px;
    line-height: 46px;
    color: #333;
    text-align: center;
    font-weight: bold;
    transition: color 0.3s ease;

    &:hover {
      color: #555;
    }
  }

  &-image {
    display: block;
    margin: 50px auto;
    max-width: 300%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;

    &:hover {
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }
  }
}
</style>
